package com.changgou.order.feign;

import com.changgou.entity.Result;
import com.changgou.order.pojo.Order;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@FeignClient(name = "order")
public interface OrderFeign {

    @PostMapping("/order")
    public Result add(@RequestBody Order order);

    @GetMapping("/order/{id}")
    public Result<Order> findById(@PathVariable("id") String id);

    @PutMapping(value="/order/{id}")
    public Result update(@RequestBody Order order, @PathVariable("id") String id);

    @GetMapping(value = "/order/search" )
    public Result<List<Order>> findList(@RequestParam Map searchMap);

    @DeleteMapping(value = "/order/{id}" )
    public Result delete(@PathVariable("id") String id);

    }
